﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TravelAgentsDesktopDBApp
{
    public partial class FormParent : Form
    {
        
        public FormParent()
        {
            InitializeComponent();

        }

        private void openPkgMgr()
        {
            //declare new instance of FormPackages Class
            FormPackages pkgForm = new FormPackages();

            //set this window to the perent window
            pkgForm.MdiParent = this;

            //show the FormPackages Form
            pkgForm.Show();
        }

        private void openProdMgr()
        {
            //declare new instance of FormProducts Class
            FormProducts prodForm = new FormProducts();

            //set this window to the perent window
            prodForm.MdiParent = this;

            //show the FormProducts Form
            prodForm.Show();
        }

        private void openSupMgr()
        {
            //declare new instance of FormSuppliers Class
            FormSuppliers supForm = new FormSuppliers();

            //set this window to the perent window
            supForm.MdiParent = this;

            //show the FormSuppliers Form
            supForm.Show();
        }

        private void showMenu()
        {
            pnlMenu.Visible = true;
            pnlMenu.Enabled = true;
        }

        private void hideMenu()
        {
            pnlMenu.Visible = false;
            pnlMenu.Enabled = false;
        }

        private void btnOpenPkgMgr_Click(object sender, EventArgs e)
        {
            hideMenu();
            openPkgMgr();
        }

        private void btnOpenProdMgr_Click(object sender, EventArgs e)
        {
            hideMenu();
            openProdMgr();
        }

        private void btnOpenSupMgr_Click(object sender, EventArgs e)
        {
            hideMenu();
            openSupMgr();
           
        }

        private void btnExitApp_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }



        private void pnlHide_MouseLeave(object sender, EventArgs e)
        {
            hideMenu();
        }

        private void pnlMinMenu_MouseHover(object sender, EventArgs e)
        {
            showMenu();
            pnlWelcome.Visible = false;
        }

        private void FormParent_Load(object sender, EventArgs e)
        {
            hideMenu();
        }

        private void miniIcon_MouseHover(object sender, EventArgs e)
        {
            showMenu();
        }







        

         }
}
